package com.iims.common.core.domain.entity;

import java.util.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.iims.common.core.domain.BaseEntity;

/**
 * 菜单权限表 sys_menu
 *
 * @author fanpei
 */
@ApiModel("菜单实体")
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("cmis_sys_menu")
public class SysMenu extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 菜单ID
     */
    @ApiModelProperty(name = "menuId", value = "主键,修改时必传", position = -1)
    @TableId(value = "menu_id", type = IdType.AUTO)
    private Long menuId;

    /**
     * 菜单名称
     */
    @ApiModelProperty(value = "菜单名称，菜单名称长度不能超过50个字符", required = true)
    @NotBlank(message = "菜单名称不能为空")
    @Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符")
    private String menuName;

    /**
     * 父菜单名称
     */
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private String parentName;

    /**
     * 父菜单ID
     */
    @ApiModelProperty(value = "父菜单ID", required = true)
    private Long parentId;

    /**
     * 显示顺序
     */
    @ApiModelProperty(value = "显示顺序", required = true)
    @NotBlank(message = "显示顺序不能为空")
    private String orderNum;

    /**
     * 路由地址
     */
    @ApiModelProperty(value = "路由地址:路由地址不能超过200个字符", required = true)
    @Size(min = 0, max = 200, message = "路由地址不能超过200个字符")
    private String path;

    /**
     * 组件路径
     */
    @ApiModelProperty(value = "组件路径:组件路径不能超过255个字符（菜单具备此项）")
    @Size(min = 0, max = 255, message = "组件路径不能超过255个字符")
    private String component;

    /**
     * 是否为外链（0是 1否）
     */
    @ApiModelProperty(value = "是否为外链", required = true)
    private String isFrame;

    /**
     * 是否缓存（0缓存 1不缓存）
     */
    @ApiModelProperty(value = "是否缓存", required = true)
    private String isCache;

    /**
     * 类型（M目录 C菜单 F按钮）
     */
    @ApiModelProperty(value = "类型：M目录 C菜单 F按钮", required = true)
    @NotBlank(message = "菜单类型不能为空")
    private String menuType;

    /**
     * 显示状态（0显示 1隐藏）
     */
    @ApiModelProperty(value = "显示状态：来源于字典sys_show_hide", required = true)
    private String visible;

    /**
     * 菜单状态（0正常 1停用）
     */
    @ApiModelProperty(value = "菜单状态：来源于字典sys_normal_disable", required = true)
    private String status;

    /**
     * 权限字符串
     */
    @ApiModelProperty(value = "权限字符串:权限标识长度不能超过100个字符（菜单和按钮具备此项）")
    @Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符")
    private String perms;

    /**
     * 菜单图标
     */
    @ApiModelProperty(value = "菜单图标")
    private String icon;

    /**
     * 子菜单
     */
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private List<SysMenu> children = new ArrayList<SysMenu>();
}
